import Vue from 'vue'
import VueRouter from 'vue-router'
// 后台管理系统
import MainFrame from "@/views/MainFrame";    // 后台右侧菜单栏
import Home from "@/views/Home";        // 后台首页
// 基本信息管理
import Staff from "@/views/Staff";
import Vehicle from "@/views/Vehicle";
import Address from "@/views/Address";
import Company from "@/views/Company";
import Material from "@/views/Material";
import Goods from "@/views/Goods";
// 车辆维修管理
import VehicleRepair from "@/views/VehicleRepair";

// 前台
import OfficialWeb from "@/views/OfficialWeb";
// 机电设备
import Electromec from "@/views/Electromec";
import WebHeaderFooter from "@/components/WebHeaderFooter";
import Message from "@/views/Message";
// 建筑购物
import BuildInfo from "@/views/BuildInfo";
import Announcement from "@/views/Announcement";

import Msgmanger from "@/views/Msgmanger";
import Login from "@/views/Login";
import Repairman from "@/views/Repairman";
import VehicleRepairMaterial from "@/views/VehicleRepairMaterial";

import OfficeMaterial from "@/views/OfficeMaterial";
import Advertisement from "@/views/Advertisement";
import OfficeMaterialPurchase from "@/views/OfficeMaterialPurchase";
import OfficeUsage from "@/views/OfficeUsage";


import goodslPurchase from "@/views/GoodslPurchase";
import goodsUsage from "@/views/GoodsUsage";
import materialPurchase from "@/views/MaterialPurchase";
import materialUsage from "@/views/MaterialUsage";
import lineChart from "@/views/LineChart";
import distributionChart from "@/views/DistributionChart";
import histogram from "@/views/Histogram";
import transportTask from "@/views/TransportTask";
import BusinessRecords from "@/views/BusinessRecords";
import vehicleoperation from "@/views/Vehicleoperation";
import Railwaytransportation from "@/views/Railwaytransportation";

import NotFound from "@/views/NotFound";

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'MainFrame',
        component: MainFrame,
        redirect: "/login",
        children: [
            // 后台首页
            {path: 'home', name: '主页', component: Home},
            // 基本信息管理
            {path: 'staff', name: '人员信息管理', component: Staff},
            {path: 'vehicle', name: '车辆信息管理', component: Vehicle},
            {path: 'address', name: '地址信息管理', component: Address},
            {path: 'company', name: '公司信息管理', component: Company},
            {path: 'material', name: '物资基本信息', component: Material},
            {path: 'goods', name: '货物基本信息', component: Goods},
            {path: 'electromec', name: '机电设备基本信息', component: Electromec},
            {path: 'buildInfo', name: '建筑购物基本信息', component: BuildInfo},
            {path: 'officeMaterial',name: '办公耗材',component: OfficeMaterial},

            // 购销存系统
            {path: 'officeMaterialPurchase',name: '办公耗材采购',component: OfficeMaterialPurchase},
            {path: 'officeUsage',name: '办公耗材采购',component: OfficeUsage},

            // 车辆检修管理
            {path: 'vehicleRepair', name: '维修记录管理', component: VehicleRepair},
            {path: 'vehicleRepairMaterial', name: '物资使用记录', component: VehicleRepairMaterial},

            // 对外商务管理
            {path: 'announcement', name: '公告管理', component: Announcement},
            {path: 'msgmanger', name: '公告管理', component: Msgmanger},
            {path: 'repairman', name: '维修人员上传修理表', component: Repairman},
            {path: 'advertisement', name: '销售公告管理', component: Advertisement},
            {path: 'goodslPurchase', name: '货物采购', component: goodslPurchase},
            {path: 'goodsUsage', name: '货物使用', component: goodsUsage},
            {path: 'materialPurchase', name: '物资采购', component: materialPurchase},
            {path: 'materialUsage', name: '物资使用', component: materialUsage},
            {path: 'vehicleoperation', name: '车辆运营', component: vehicleoperation},


            {path: 'transportTask', name: '运输任务', component: transportTask},
            {path: 'railwaytransportation', name: '运输任务', component: Railwaytransportation},

            {path: 'lineChart', name: '线性折线图', component: lineChart},
            {path: 'distributionChart', name: '业务分布图', component: distributionChart},
            {path: 'histogram', name: '产值利润柱状图', component: histogram},




            {path: 'businessRecords', name: '产值利润柱状图', component: BusinessRecords},


        ]
    },
    {
        path: '/pzhwlxt', name: '官网框架', component: WebHeaderFooter,
        children: [
            {path: '', name: '官网内容', component: OfficialWeb},
            {path: 'message', name: '在线留言', component: Message},
        ]
    },
    {path: '/login', name: '登录', component: Login,},
    {path: '*', name: 'NotFound', component: NotFound,}

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
